window.onload = function() {

	oDiv = document.getElementById('div');
	document.addEventListener('mousemove', divMove, false);
};

var oDiv = null;

function divMove(ev) {
	ev = ev || event;

	var scrollLeft = document.documentElement.scrollLeft || 
		document.body.scrollLeft;
	var scrollTop = document.documentElement.scrollTop || 
		document.body.scrollTop;

	oDiv.style.left = ev.clientX + scrollLeft + 'px';
	oDiv.style.top = ev.clientY + scrollTop + 'px';
}
